<?php
require_once(ML_ROOT."/service.php");

function on_models()
{
	if ($_SERVER["REQUEST_METHOD"] == "POST") {
		
	}
	elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
		
	}
	else ;
}

function on_pictures()
{
	if ($_SERVER["REQUEST_METHOD"] == "POST") {
		
	}
	elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
		
	}
	else ;
}

function on_users()
{
	require_once(ML_DATA."/user.php");
	
	$result[Protocol::SUCCESS] = FALSE;
	if ($_SERVER["REQUEST_METHOD"] == "POST") {
		
	}
	elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
		DBConnector::connect();
		if (isset($_GET[Protocol::ID])) $result[Protocol::CONTENT] = User::get($_GET[Protocol::ID]);
		else $result[Protocol::CONTENT] = User::get_list();
		DBConnector::close();
	}
	else ;
	
	echo(json_encode($result));
}
